<template>
	<div>
		<el-button type="primary" size="default" @click="apiGet">get</el-button>
		<el-button type="primary" size="default" @click="apiPost">post</el-button>
		<input type="file" @change="upload" />
	</div>
</template>
<script setup>
	import axios from 'axios';

	const apiGet = () => {
		axios.get('http://127.0.0.1:9001/user?userId=12345');
		axios.get('http://127.0.0.1:9001/user', {
			params: {
				userId: '0001212',
			},
		});
	};
	const apiPost = () => {
		axios.post('http://127.0.0.1:9001/user', {
			firstName: 'Fred',
			lastName: 'Flintstone',
		});
	};
	const upload = e => {
		const formData = new FormData();
		formData.append('file', e.target.files[0]);
		axios.post('http://127.0.0.1:9001/upload', formData);
	};
</script>
